{% load static %}
<!doctype html>
<html class="no-js" lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Join</title>
    <meta name="description" content="Chat">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" type="text/css" href="{% static 'chat/normalize.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'chat/main.css' %}">

    <script src="{% static 'chat/jquery-3.2.1.min.js' %}"></script>
    <script type="text/javascript">
      $(function () {
        $('#join-form').submit(function () {
          var user = $('#nick-input').val();
          if(user) {
            window.location = '/{{ room_id|escapejs }}?user=' + user;
          }
          return false;
        });

        $('#nick-input').focus();
      });
    </script>
  </head>
  <body>
    <div id="join-elements">
      <form id="join-form">
        <input type="text" id="nick-input" placeholder="Nickname" />
        <input type="submit" id="join-button" value="Join" />
      </form>
    </div>
  </body>
</html>
